﻿<Window x:Class="eDirectory.WPF.Agenda.View.AddressDetailView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="AddressDetailView" Height="220" Width="300" WindowStartupLocation="CenterScreen">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Name="AddressDetails" Height="Auto"/>
            <RowDefinition Name="Commands" Height="Auto"/>
        </Grid.RowDefinitions>
        <GroupBox Header="Address Details" Margin ="5" Padding="5">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Name="Street" />
                    <RowDefinition Name="City" />
                    <RowDefinition Name="PostCode" />
                    <RowDefinition Name="Country" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Name="Label" />
                    <ColumnDefinition Name="Value" />
                </Grid.ColumnDefinitions>

                <Label Grid.Row="0">Street:</Label>
                <Label Grid.Row="1">City:</Label>
                <Label Grid.Row="2">Post Code:</Label>
                <Label Grid.Row="3">Country:</Label>

                <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Path=Model.Address.Street, Mode=TwoWay, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource validationTemplate}"></TextBox>
                <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Path=Model.Address.City, Mode=TwoWay, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource validationTemplate}"></TextBox>
                <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding Path=Model.Address.PostCode, Mode=TwoWay, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource validationTemplate}"></TextBox>
                <TextBox Grid.Row="3" Grid.Column="1" Text="{Binding Path=Model.Address.Country, Mode=TwoWay, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource validationTemplate}"></TextBox>
            </Grid>
        </GroupBox>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1">
            <Button Padding="5" Margin="5" Command="{Binding Path=CancelCommand}" IsCancel="True">Cancel</Button>
            <Button Padding="5" Margin="5" Command="{Binding Path=SaveCommand}">Save</Button>
        </StackPanel>
    </Grid>
</Window>

